//
// Created by Lenovo on 2020/8/27.
//
#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
#define inf 0x3f3f3f3f
using namespace std;
const int maxn = 1e3+10;
int n,m,k;
int mp[maxn][maxn];
int route[maxn];
int vis[maxn];
int dis[maxn];
void dij(int x,int y)
{
    int pos;
    memset(vis,0,sizeof(vis));
    for(int i = 1;i<=n;i++) dis[i] = mp[x][i];
    for(int i = 0;i<=k+1;i++) if(route[i]!=x&&route[i]!=y) vis[route[i]] = 1;
    for(int i = 2;i<=n;i++)
    {
        int minn = inf;
        for(int j = 1;j<=n;j++)
        {
            if(vis[j]==0&&dis[j]<minn)
            {
                minn = dis[j];
                pos = j;
            }
        }
        vis[pos] = 1;
        if(minn>=inf) break;
        for(int j = 1;j<=n;j++)
        {
            if(vis[j]==0&&dis[pos]+mp[pos][j]<dis[j]) dis[j] = dis[pos]+mp[pos][j];
        }
    }
}
int main()
{

    while(scanf("%d %d %d",&n,&m,&k)!=EOF)
    {
        for(int i = 1;i<=n;i++)
        {
            for(int j = 1;j<=n;j++)
            {
                if(i==j) mp[i][j] = 0;
                else mp[i][j] = inf;
            }
        }

        if(n==0&&m==0&k==0) return 0;
        for(int i = 1;i<=m;i++)
        {
            int u,v,val;
            //printf("********\n");
            scanf("%d %d %d",&u,&v,&val);
            if(val<mp[u][v]) mp[u][v] = mp[v][u] = val;
        }
        route[0] = 1;
        for(int i = 1;i<=k;i++) scanf("%d",&route[i]);
        route[k+1] = n;
        int ans = 0;
        int flag = 1;
        for(int i = 0;i<=k;i++)
        {
            dij(route[i],route[i+1]);
            if(dis[route[i+1]]>=inf)
            {
                flag = 0;
                break;
            }
            ans += dis[route[i+1]];
        }
        if(!flag) printf("Impossible\n");
        else printf("%d\n",ans);
    }

}